package com.mikelouis.test.scala.proginscala.chapter14

import org.scalatest.Suite

/**
 * Use ScalaTest to write test suite
 *
 * Created by yuazhu on 1/14/2015.
 */
class Element2ScalaTestSuite extends Suite {

  def testUniformElement(): Unit = {
    val ele = Element2.elem('x', 2, 3)
    assert(ele.width == 2)

    intercept[IllegalArgumentException] {
      Element2.elem('x', -2, 3)
      throw new IllegalArgumentException("manually throw IllegalArgumentException")
    }
  }
}
